from collections.abc import Mapping
from typing import Any, NotRequired, Self, Sequence, TypedDict


class DatasetLoaderConfig(TypedDict):
    module: str
    qualname: str
    args: NotRequired[Sequence[str] | None]
    kwargs: NotRequired[Mapping[str, Any] | None]


class DatasetMetadata(TypedDict):
    loader: NotRequired[DatasetLoaderConfig | None]

    # predefined fields
    name: NotRequired[str | None]
    samples_n: NotRequired[int | None]
    children: NotRequired[Mapping[str, Self] | Sequence[Self] | None]
